<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:body>
	<ui:composition template="template.xhtml">
		<ui:define name="content">
			<script src="http://maps.google.com/maps/api/js?sensor=false"
				type="text/javascript" />
			<script type="text/javascript"
				src="../resources/javascript/mapCodeSovtivityPoint.js" />
			<f:view>

				<h1>
					<h:outputText value="Create Ticket" />
				</h1>

				<div>
					<h:form id="panel1Form">
						<div class="formBlock">
							<fieldset>
								<legend>
									<h:outputText value="What?" />
								</legend>
								<!-- description -->
								<div>
									<h:outputLabel for="description" value="Description:" />
									<p:inputTextarea id="description"
										value="#{ticketController.ticket.description}"
										style="width:30em" required="true"
										requiredMessage="We need a description">
									</p:inputTextarea>
								</div>
								<!-- <p:message for="description" /> -->


							</fieldset>
							<fieldset>

								<legend id="customerData">
									<h:outputText value="Who?" />
								</legend>
								<!-- Vorname -->
								<div>
									<h:outputLabel for="firstname" value="First Name:" />
									<p:inputText id="firstname" style="width:15em"
										value="#{ticketController.ticket.customer.firstName}"
										required="true" requiredMessage="We need your first name."
										label="First name">
										<f:validateLength minimum="2" />
									</p:inputText>
								</div>
								<!-- <p:message for="firstname" /> -->


								<!-- Nachname -->
								<div>
									<h:outputLabel for="lastname" value="Last Name:" />
									<p:inputText id="lastname"
										value="#{ticketController.ticket.customer.lastName}"
										style="width:15em" required="true"
										requiredMessage="We need your last name" label="Last name">
										<f:validateLength minimum="2" />
									</p:inputText>
								</div>
								<!-- telno -->
								<div>
									<h:outputLabel for="telno" value="Phone Number:" />
									<p:inputText id="telno"
										value="#{ticketController.ticket.customer.telNo}"
										style="width:15em" required="true"
										requiredMessage="We need your phone number">
									</p:inputText>
								</div>
								<!-- <p:message for="telno" /> -->

								<!-- Mail -->
								<div>
									<h:outputLabel for="email" value="E-Mail Address:" />
									<p:inputText id="email"
										value="#{ticketController.ticket.customer.mailAddress}"
										style="width:15em" required="true"
										requiredMessage="We need your Email address"
										validatorMessage="invalid Email address">
										<f:validateRegex
											pattern="([^.@]+)(\.[^.@]+)*@([^.@]+\.)+([^.@]+)" />
									</p:inputText>
								</div>
							</fieldset>
							<fieldset>
								<legend id="#location">
									<h:outputText value="Where?" />
								</legend>
								<!-- <p:message for="lastname" /> -->

								<!-- Strasse -->
								<div>
									<h:outputLabel for="street" value="Street" />
									<p:inputText id="street"
										value="#{ticketController.ticket.customer.address.street}"
										style="width:15em" required="true"
										requiredMessage="We need your street and house number"
										label="Street">
										<f:validateLength minimum="2" />
									</p:inputText>
								</div>

								<!-- <p:message for="street" /> -->

								<!-- zip -->
								<div>
									<h:outputLabel for="zip" value="ZIP" />
									<p:inputText id="zip"
										value="#{ticketController.ticket.customer.address.zip}"
										style="width:15em" required="true"
										requiredMessage="We need your zip code" label="ZIP">
										<f:validateLength minimum="2" />
									</p:inputText>
								</div>
								<!-- <p:message for="zip" /> -->

								<!-- city -->
								<div>
									<h:outputLabel for="city" value="City" />
									<p:inputText id="city"
										value="#{ticketController.ticket.customer.address.city}"
										style="width:15em" required="true"
										requiredMessage="We need your city" label="City">
										<f:validateLength minimum="2" />
									</p:inputText>
								</div>
								<!-- <p:message for="city" /> -->

								<!-- country -->
								<div>
									<h:outputLabel for="country" value="Country" />
									<p:inputText id="country"
										value="#{ticketController.ticket.customer.address.country}"
										style="width:15em" required="true"
										requiredMessage="We need your country" label="Country">
										<f:validateLength minimum="2" />
									</p:inputText>
								</div>
								<!-- <p:message for="country" /> -->


								<!-- <p:message for="email" /> -->

								<div>
									<p:commandButton id="submitData" value="create Ticket"
										icon="ui-icon-check" action="#{ticketController.saveTicket}" />

									<p:commandButton id="abort" value="Abort"
										icon="ui-icon-circle-close"
										action="#{ticketController.abortTicket}" immediate="true" />
								</div>
							</fieldset>
						</div>
					</h:form>
					<p></p>
					<br></br>
					<p></p>
				</div>
			</f:view>
		</ui:define>
	</ui:composition>
</h:body>
</html>